﻿using MiniErp.Model.Entities.AssetManagement;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace MiniErp.Model.Entities
{
    /// <summary>
    /// 用户信息实体
    /// </summary>
    [Table("UserInfo")]
    public class UserInfoEntity
    {
        /// <summary>
        /// 工号
        /// </summary>
        [Key]
        [MaxLength(6)]
        [MinLength(6)]
        public int UId { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [MaxLength(12), Required]
        [MinLength(6)]
        public string PassWord { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [MaxLength(12), Required]
        [MinLength(2)]
        public string UserName { get; set; }

        /// <summary>
        /// 权限
        /// </summary>
        [MaxLength(1), Required]
        public int Rights { get; set; }
        /// <summary>
        /// 状态（在职，离职）
        /// </summary>
        [MaxLength(1), Required]
        public bool State { get; set; }
        /// <summary>
        /// 手机号码
        /// </summary>
        [MaxLength(11)]
        [MinLength(11)]
        public long PhoneNumber { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        [MaxLength(17)]
        public string MailBox { get; set; }


        public List<AssetInfoEntity> AssetInfos { get; set; }

    }
}
